package edu.xlh.travel.controller.admin;

import edu.xlh.travel.common.Result;
import edu.xlh.travel.service.UploadFileService;
import edu.xlh.travel.syslog.annontion.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/uploadFile")
public class UploadFileController {
    @Autowired
    private UploadFileService uploadFileService;

    @Log("上传照片")
    @RequestMapping("/{uploadFileServiceType}")
    public Result uploadFile(@RequestParam("file") MultipartFile file ,
                             @PathVariable("uploadFileServiceType") String uploadFileServiceType ) throws Exception {
        return uploadFileService.uploadFile(file , uploadFileServiceType);
    }
}
